package com.pin.zheng.xingmulibrary;

import android.app.Application;
import android.content.Context;


public class PinZhengBase {
    private static Application sContext;

    private static Class apiservice;
    /**
     * 保存在手机里面的文件名
     */
    private static String FILE_NAME = "freezing_date";

    private static String baseUrl;

    private static boolean deBug;

    public static String getToken() {
        return token;
    }

    public static void setToken(String token) {
        PinZhengBase.token = token;
    }

    private static String token;

    /**
     * 初始化
     *
     * @param context 上下文
     */
    public static void init(Application context) {
        sContext = context;
    }

    public static Context getContext() {
        return sContext;
    }

    private static void testInitialize() {
        if (sContext == null) {
            throw new ExceptionInInitializerError("请先在全局Application中调用 PinZhengBase.init() 初始化！");
        }
    }

    /**
     * 保存在手机里面的文件名
     *
     * @param name 上下文
     */
    public static void setSpFileName(String name) {
        FILE_NAME = name;
    }

    public static String getSpFileName() {
        return FILE_NAME;
    }

    /**
     * 设置url
     *
     * @param BaseUrl
     */
    public static void setBaseUrl(String BaseUrl) {
        baseUrl = BaseUrl;
    }

    public static String getBaseUrl() {
        return baseUrl;
    }
    public static void setAPIService(Class api) {
        apiservice =  api;
    }

    public static  Class getApiservice(){
        return apiservice;
    }

    public static void setDeBug(boolean debug){
        deBug=debug;
    }

    public static boolean getDeBug(){
        return deBug;
    }

}
